package org.huawei260.TiKu.ODsuanfa;

import java.util.Arrays;
import java.util.StringJoiner;
import java.util.Arrays;
import java.util.Scanner;
import java.util.StringJoiner;
/**
 * @Author: qingle
 * @Date: 2024/10/28-16:11
 * @Description: 2557 【排序】2024D最低位排序
 * @version: 1.0
 */
public class D_2024D_2557__排序最低位排序 {


//	public class Main {
		// 输入获取
		public static void main(String[] args) {
			Scanner sc = new Scanner(System.in);
			String[] arr = sc.nextLine().split(",");
			System.out.println(getResult(arr));
		}

		// 算法入口
		public static String getResult(String[] arr) {
			Arrays.sort(arr, (a, b) -> a.charAt(a.length() - 1) - b.charAt(b.length() - 1));

			StringJoiner sj = new StringJoiner(",");
			for (String s : arr) sj.add(s);
			return sj.toString();
		}
	}